<template>
  <el-row>
    <el-col :span="14" :offset="4">
      <video id="myVideo" class="video-js vjs-default-skin">
        <source src="../assets/download.mp4" type="video/mp4">
      </video>
    </el-col>
  </el-row>
</template>

<script>
export default {
  name: 'localVideo',
  components: {},
  data () {
    return {
      layer: null
    }
  },
  mounted () {
    this.playerVideo('myVideo')
  },
  methods: {
    // 视频播放
    playerVideo (id) {
      this.layer = this.$video(id, {}, function onPlayerReady () {
        this.play()
        this.on('ended', function () {
          console.log('Awww...over so soon?!')
        })
      })
    }
  },
  destroyed () {
    this.layer.dispose()
  }
}
</script>
